package cn.enjoy.controller;

import cn.enjoy.entity.User;
import cn.enjoy.service.IUserService;
import cn.enjoy.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author K
 * @date 2022-12-28 15:39
 */
@RestController
@RequestMapping("baomidou")
public class BaomidouDynamicDBController {

    @Resource
    private IUserService userService;


//    @GetMapping("/getUserByMaster")
//    public R getUserByMaster(Long id) {
//        User user = userService.selectByIdMaster(id);
//        return R.data(user);
//    }

    @GetMapping("/getUserBySlave1")
    public R getUserBySlave1(Long id) {
        User user = userService.selectByIdSlave1(id);
        return R.data(user);
    }

}
